package com.itheima.service.impl;

import com.itheima.dao.ProductDao;
import com.itheima.domain.Product;
import com.itheima.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Optional;

/**
 * @author MI
 * @ClassName UserServiceImpl.java
 * @createTime 2021年11月14日 22:37:00
 */
@Service
public class ProductServiceImpl implements ProductService {
    @Autowired
    ProductDao productDao;

    @Override
    public Product findByPid(Integer pid) {
        Optional<Product> byId = productDao.findById(pid);
        return byId.get();
    }
}
